<?php
include("../inc/conn.inc");
include("../inc/search_page.php");
$hover=2;
$url="search.php";
$thepage=$_GET['page']?$_GET['page']:1;
$maxpage=20;
$_GET[subject] = htmlspecialchars($_GET[subject]);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=$_GET[subject]?>-产品搜索-产品供应</title>
<link href="/css/body.css" rel="stylesheet" type="text/css" />
<link href="/css/link.css" rel="stylesheet" type="text/css" />
<link href="/css/head_1.css" rel="stylesheet" type="text/css" />
<link href="/Supply/css/list.css" rel="stylesheet" type="text/css" />
<link href="/css/foot.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php include("../inc/head_top.php")?>
<?php include("../inc/menu_2.php")?>
<div id="mian" class="topside6 side">
<div class="title">您所在的位置：<a href="/">首页</a> >> 产品搜索 >> <?=$_GET[subject]?></div>
<div class="onl"></div>
</div>
<div class="w960 topside20 side">
<script type="text/javascript">/*960*90，创建于2011-3-9*/ var cpro_id = 'u403357';</script><script src="http://cpro.baidu.com/cpro/ui/c.js" type="text/javascript"></script>
<div class="onl"></div>
</div>
<div id="mian" class="topside6  sideyellow backyellow">
<div class="title1 size14 b"></div>
<div class="Class backwhite sideyellow1">
<ul>
<div align="center">
<script type="text/javascript">var mainone_wordtype=1;  var mainone_mainword="subject";var mainone_if_width=930;var mainone_color_bg="";var mainone_color_bd="";var mainonestyle=1; </script><script src=" http://acode.b2b.cn/JS/Keyword_New.js" type="text/javascript"></script>
</div>
</ul>
<div class="onl"></div>
</div>
</div>

<div class="w960 topside6 side">
<div id="adblock1"></div>
</div>

<div id="mian" class="topside6">
  <div class="onl"></div>
<div class="leftmain">
<div>
<DIV class="zzb3 side">
<DIV style="width:120px;float:left;height:25px;line-height: 25px;" align="center">图片</DIV>
<DIV style="width:276px;float:left;height:25px;line-height: 25px;" align="center">供应产品信息</DIV>
<DIV style="width:100px;float:left;height:25px;line-height: 25px;" align="center">
<form method="post" action="">
<select name="city" id="city"  onChange="javascript:submit()">
<option value="">--选择省份--</option>
<?php
          $result = mysql_query("select * from city where city_id=0 order by order_name asc");    
          while($res = mysql_fetch_array($result)){    
          ?>    
          <option value="<?=$res['id']?>"><?=$res['city_name']?></option> 
          <?php }?>  
</select>
</form></DIV>
<DIV style="width:90px;float:left;height:25px;line-height: 25px;" align="center">单价/起定量</DIV>
<DIV style="width:80px;float:left;height:25px;line-height: 25px;" align="center">会员类型</DIV>
</DIV>
<?php
if($_POST[city]){
$sqls=" and member.m_pro='$_POST[city]'";
}

// (product.p_title like '%$_GET[subject]%' ) and

if($_GET['subject']){
$kw=htmlspecialchars(trim($_GET['subject']));
//$kw=split("( )+",$kw);
//   foreach ($kw as $key=>$value){
 //  $sqls2.=" product.p_title regexp '$value' ||";
//   }
//$sqls2=" and (".substr($sqls2,0,-2).")";
//$sqls=$sqls.$sqls2;
$sqls=" and product.p_title like '%".$kw."'";
}

if($thepage==1){
$sqls2=" group by member.id ";
}


$rs=mysql_query("select product.id,product.p_title,product.picture,product.p_addtime,product.p_info,product.p_price,product.p_minorder,member.m_type,member.m_user,member.m_cname,member.pro,member.city from product inner join member on product.member_id=member.id where product.p_sh=1  ".$sqls.$sqls2." order by product.id desc limit ".($thepage-1)*$maxpage.",$maxpage");
while($row=mysql_fetch_array($rs)){
if($row[m_type]==6){
   $m_url="http://$row[m_user].sandib2b.cn/";
   $m_url2="http://$row[m_user].sandib2b.cn/contact.htm";
}else{
   $m_url="/cn/template/$row[m_user]/";
   $m_url2="/cn/template/$row[m_user]/contact.html";
}
?>
<DIV class=zzb4 id=Info6197>
<DIV class=zzb4-2>
<a href="/supply/<?=$row['id']?>.html" target="_blank">
<?php if(trim($row[picture])){?>
<img src="/upfile/<?=$row[picture]?>"  border="0" width="91" height="83"/>
<?php }else{?>
<img src="/images/prono88.gif" width=91 height=83 border="0" />
<?php }?></a></DIV>
<DIV class=zzb4-3>
<DIV class=zzb4-3-1><a href="/supply/<?=$row['id']?>.html" target="_blank"><?=str_replace("$_GET[subject]","<font color='red'>$_GET[subject]</font>",mb_substr($row[p_title],0,16,'utf-8'))?></a><SPAN 
style="FONT-WEIGHT: normal" class="size10 fontgray"><?=date("Y-m-d",strtotime($row[p_addtime]))?></SPAN></DIV>
<DIV class=zzb4-3-Time></DIV>
<DIV class=zzb4-3-2><?=mb_substr(strip_tags($row[p_info]),0,50,'utf-8')?></DIV>
<DIV class=zzb4-3-3>
<DIV style="FLOAT: left;font-weight: lighter;"><A href="<?=$m_url?>" target=_blank><?=$row['m_cname']?></A> </DIV>
<DIV style="FLOAT: right; COLOR: #999999;font-weight: lighter;">[<?=$row[pro]?>-<?=$row['city']?>] </DIV></DIV></DIV>
<DIV class=zzb5>
  <DIV style="TEXT-ALIGN: center" class="fontred size14 b"><?=$row[p_price]?></DIV>
<div class="size11 fontgray"><?=$row[p_minorder]?></div></DIV>
<DIV class=zzb52>
<div style="COLOR: #999999;font-weight: lighter;">
<?php if($row[m_type]==6){?>
<a href="<?=$m_url?>certificate.htm" target="_blank"><img src="/images/member1.gif"/ border="0"></a><?php }?></div>
</DIV>
<DIV class=zzb53>
  <div class="ms"><a href="<?=$m_url2?>" target="_blank"><img src="/images/list01.gif" border="0" /></a></div>
  <div class="ms"><a href="/supply/<?=$row['id']?>.html" target="_blank"><img src="/images/list02.gif" border="0" /></a></div>
</DIV>
<div class="onl"></div>
</DIV>
<?php }
$rs2=mysql_query("select count(id) from product  where p_sh=1 ".$sqls);
$totalrecord=mysql_result($rs2,0); 
$totalpage=ceil($totalrecord/$maxpage);
mysql_free_result($rs2);


?>

</div>
<div class="onl"></div>
<div id="adblock2"></div>
<div class="page">
<div class="pageleft">
<ul>
<?php pages($thepage,$totalpage,$maxpage,4);?>
</ul>
</div>
<div class="pageright">
<form name="pageform" method="post" action="" onSubmit="return onCheckPage()"> 
共<?=$totalpage?>页　到
<input type="text" name="page" class="input-txt" size="5" maxlength="5">页
<input type="submit" value="确定" class="but">
</form>
<script language="javascript"> 
function onCheckPage(){ 
var page = parseInt(document.pageform.page.value); 
if(isNaN(page)){ 
alert("Please enter the number (1,<?=$totalpage?>)"); 
return false; 
}
}
</script>
  </div>
<div class="onl"></div>
</div>
<!--page end-->
</div>
<div class="rightmain">
  <div class="right side">
  <div class="title b">黄金展位供应商</div>
   <div style="width:180px;" align="center">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-2924453545159453";
/* 供应搜索 */
google_ad_slot = "0050917610";
google_ad_width = 160;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
	</div>
  <div style="width:180px; margin-top:20px;" align="center"><script type="text/javascript"> /*160*600，创建于2010-8-4*/ var cpro_id = 'u136291';</script>
<script type="text/javascript" src="http://cpro.baidu.com/cpro/ui/c.js"></script>
</div>
  </div>
</div>
<div class="onl"></div>
</div>



<div id="mian" class="topside6  sideyellow backyellow">
<div class="title1 size14 b" style="color:#FF0000;">为了节省您的时间，您在求购过程中没找到合适产品或供应商，请发布紧急求购产品信息。让商家联系您。&nbsp;&nbsp;<a href="/caigou/" target="_blank">立即发布紧急求购</a></div>
</div>

<div class="w960 topside20 downside20 side">
<script type="text/javascript">/*960*90，创建于2011-3-9*/ var cpro_id = 'u403357';</script><script src="http://cpro.baidu.com/cpro/ui/c.js" type="text/javascript"></script>
<div class="onl"></div>
</div>
<?php include("../inc/foot.php");?>
</body>
</html>
<script language="javascript">
function $(id){
return document.getElementById(id);
}
function listfoot(){
if($("subject").value==""){
alert("请输入您要搜索的关键字");
$("subject").focus();
return false;
}
}
</script>
<script type="text/javascript">/*120*270，创建于2010-12-18*/ var cpro_id = 'u319758';</script><script src="http://cpro.baidu.com/cpro/ui/f.js" type="text/javascript"></script>


<script src="http://www.google.com/jsapi">
</script>
<script type="text/javascript" charset="utf-8">
google.load('ads.search', '2');
</script>
<script type="text/javascript" charset="utf-8">
var pageOptions = {
'pubId' : 'pub-2924453545159453',
'query' : '<?=$_GET[subject]?>'
}
var adblock1 = {
'container' : 'adblock1',
'number' : 3,
'width' : 'auto',
'lines' : 2,
'fontFamily' : 'arial',
'fontSizeTitle' : '14px',
'fontSizeDescription' : '14px',
'fontSizeDomainLink' : '14px',
'colorTitleLink' :'red',
'colorText' :'blue',
'colorDomainLink' :'blue',
'colorBorder' :'blue',
'linkTarget' :'_blank'
};
var adblock2 = {
'container' : 'adblock2',
'number' : 3,
'width' : 'auto',
'lines' : 2,
'fontFamily' : 'arial',
'fontSizeTitle' : '14px',
'fontSizeDescription' : '14px',
'fontSizeDomainLink' : '14px',
'colorTitleLink' :'red',
'colorText' :'blue',
'colorDomainLink' :'blue',
'linkTarget' :'_blank'
};
new google.ads.search.Ads(pageOptions, adblock1, adblock2);
</script>